package sqlanalysisgui.view.model.provider;

import org.eclipse.jface.viewers.LabelProvider;

import sqlanalysisgui.view.model.CrudInfo;
import sqlanalysisgui.view.model.LineInfo;
import sqlanalysisgui.view.model.TableList;

public class TableListLabelProvider extends LabelProvider {
/*	  private static final Image FOLDER = getImage("folder.gif");
	  private static final Image FILE = getImage("file.gif");
	  */
	  
	  @Override
	  public String getText(Object element) {
	    if (element instanceof TableList) {
	    	TableList tableList = (TableList) element;
	      return tableList.getTableName();
	    }else if (element instanceof CrudInfo) {
	    	CrudInfo crudInfo = (CrudInfo) element;
		      return crudInfo.getName();
	    }
	    return ((LineInfo) element).getLineName();
	  }

/*	  @Override
	  public Image getImage(Object element) {
	    if (element instanceof Category) {
	      return FOLDER;
	    }
	    return FILE;
	  }*/
/*
	  // Helper Method to load the images
	  private static Image getImage(String file) {
	    Bundle bundle = FrameworkUtil.getBundle(TableListLabelProvider.class);
	    URL url = FileLocator.find(bundle, new Path("icons/" + file), null);
	    ImageDescriptor image = ImageDescriptor.createFromURL(url);
	    return image.createImage();

	  } */
}
